package aaa

import java.beans.Introspector

/**
 * Created by TK-chenbin on 2015/4/30.
 */
class Test2 {
    static def main(args) {
        def parent = Test2.getClassLoader()
        def loader = new GroovyClassLoader(parent)
        def gclass = loader.parseClass(new File("src/main/groovy/aaa/Person2.groovy"))

        Introspector.getBeanInfo(gclass).methodDescriptors.each { println(it) }
        println("==================")
        Introspector.getBeanInfo(gclass).propertyDescriptors.each { println it }

        def p = gclass.newInstance()
        println(p)
        println(p.name)
        println(p.nameProperty())
        p.name = "456"
        println(p.name)
        println(p.nameProperty())
    }
}
